import { defineStore } from "pinia";
import { getFavorList, getHistoryList } from "../../services/modules/favorRequest";
// city 数据管理
export default defineStore("favor", {
    // 数据
    state: () => ({
        favorList: [],
        historyList: []
    }),
    // 操作
    actions: {
        async fetchFavorList() {
            const res = await getFavorList()
            this.favorList = res.data.data.items
        },
        async fetchHistoryList() {
            const res = await getHistoryList()
            this.historyList = res.data.data.items
        }
    }
})